<script lang="ts" setup name="GeneralSituation">
import {GeneralCondition, GeneralConditionParams, getGeneralCondition, rejectGeneralCondition, saveGeneralCondition} from '@/api/medicalExaminerDesk/beginPhysicalExamination/generalSituation'
import {onBeforeMount, reactive, ref, watch, computed} from 'vue'
import OdSelfcareAssess from './generalSituationModal/odSelfcareAssess.vue'
import CognitiveFunctionScreening from './generalSituationModal/cognitiveFunctionScreening.vue'
import EmotionalStateScreening from './generalSituationModal/emotionalStateScreening.vue'
import CognitiveFunctionAssess from './generalSituationModal/cognitiveFunctionAssess.vue'
import EmotionalStateAssess from './generalSituationModal/emotionalStateAssess.vue'
import {ElMessage, FormRules} from 'element-plus'
import useUser from '@/store/user'
import {Number_Decimal_3, Number_Decimal_5, Number_3, NotLeadingAndTrailingSpaces} from '@/util/common'
import {ChecksOrRadios, fieldRequired} from '@/api/medicalExaminerDesk/beginPhysicalExamination'
import {showMessageBox} from '@/util/element'
const user = useUser.setup().store

const props = defineProps({
  // 体检登记表id
  checkupRegisterId: {
    type: String,
    required: true,
    default: ''
  },
  // 禁止编辑
  disEdit: {
    type: Boolean,
    required: true,
    default: false
  },
  // 性别
  gender: {
    type: String,
    required: false,
    default: ''
  }
})

// 保存和拒检的加载
const showSaveLoading = ref<boolean>(false)

// 老年人健康状态自我评估弹窗
const showSelfcareDialog = ref(false)
// 老年人认知功能-粗筛弹窗
const cognitiveFunctionScreeningDialog = ref(false)
// 老年人认知功能-评估弹窗
const cognitiveFunctionAssessDialog = ref(false)
// 老年人情感状态-粗筛弹窗
const emotionalStateScreeningDialog = ref(false)
// 老年人情感状态-评估弹窗
const emotionalStateAssessDialog = ref(false)

// 表单实例
const formRef = ref()

// 一般状况表单
const generalSituationForm = reactive<GeneralCondition>({
  hasSymprom: false, // 是否有症状
  symprom: '1', // 症状
  sympromGroup: [], // 症状复选
  odSelfevalState: 1, // 健康状态评估
  odSelfcareState: 1, // 自理能力评估
  odSelfcareScore: '1|1|1|1|1', // 自理能力得分详情
  odSelfcareScoreTotal: 0, // 自理能力总分
  odCognState: 1, // 认知能力
  odCognCribble: '1|1', // 认知能力粗筛详情
  odCognScore: '', // 认知能力得分
  odCognScoreTotal: 0, // 认知能力总分
  odEmotionState: 1, // 情感状态
  odEmotionCribble: 0, // 情感状态粗筛详情
  odEmotionScore: '', // 情感状态得分
  odEmotionScoreTotal: 0, // 情感状态总分
  bmi: null
})

// 体检大类的体检医生姓名
const dutyDoctorName1 = computed(() => {
  return generalSituationForm.dutyDoctorName || (user.userInfor?.jobName === '医生' ? user.userInfor?.userName : '')
})

// 体检状态
const checkupStatus1 = computed(() => {
  return generalSituationForm.checkupStatus
})

// 1、症状
const sympromCheckboxs: Array<ChecksOrRadios> = [
  {label: '头痛', value: '2'},
  {label: '头晕', value: '3'},
  {label: '心悸', value: '4'},
  {label: '胸闷', value: '5'},
  {label: '胸痛', value: '6'},
  {label: '慢性咳嗽', value: '7'},
  {label: '咳痰', value: '8'},
  {label: '呼吸困难', value: '9'},
  {label: '多饮', value: '10'},
  {label: '多尿', value: '11'},
  {label: '体重下降', value: '12'},
  {label: '乏力', value: '13'},
  {label: '关节肿痛', value: '14'},
  {label: '视力模糊', value: '15'},
  {label: '手脚麻木', value: '16'},
  {label: '尿急', value: '17'},
  {label: '尿痛', value: '18'},
  {label: '便秘', value: '19'},
  {label: '腹泻', value: '20'},
  {label: '恶心呕吐', value: '21'},
  {label: '眼花', value: '22'},
  {label: '耳鸣', value: '23'},
  {label: '乳房胀痛', value: '24'},
  {label: '其他', value: '25'}
]

interface GeneralSituationInput {
  label: string
  key: string // 绑定值的键
  unit: string
}

// 2、一般状况
const generalSituationInput: Array<GeneralSituationInput> = [
  {label: '体温', key: 'tempera', unit: '℃'},
  {label: '脉率', key: 'pulseRate', unit: '次/分钟'},
  {label: '呼吸频率', key: 'breathRate', unit: '次/分钟'},
  {label: '收缩压(左)', key: 'sbpLeft', unit: 'mmHg'},
  {label: '舒张压(左)', key: 'dbpLeft', unit: 'mmHg'},
  {label: '收缩压(右)', key: 'sbpRight', unit: 'mmHg'},
  {label: '舒张压(右)', key: 'dbpRight', unit: 'mmHg'},
  {label: '身高', key: 'height', unit: 'cm'},
  {label: '体重', key: 'weight', unit: 'kg'},
  {label: '腰围', key: 'waist', unit: 'cm'},
  {label: '体质指数(BMI)', key: 'bmi', unit: 'kg/m²'}
]

// 3、老年人健康状态自我评估
const odSelfevalStateRadios: Array<ChecksOrRadios> = [
  {label: '满意', value: 1},
  {label: '基本满意', value: 2},
  {label: '说不清楚', value: 3},
  {label: '不太满意', value: 4},
  {label: '不满意', value: 5}
]

// 4、老年人生活自理能力自我评估
const odSelfcareStateRadios = [
  {label: '可自理', value: 1},
  {label: '轻度依赖', value: 2},
  {label: '中度依赖', value: 3},
  {label: '不能自理', value: 4}
]

// 校验
const rules = computed<FormRules>(() => {
  return {
    // 症状
    hasSymprom: [{required: fieldRequired('symprom'), message: '请选择症状!', trigger: ['change', 'blur']}],
    // 症状
    sympromGroup: [{required: fieldRequired('symprom'), message: '请选择症状!', trigger: ['change', 'blur']}],
    // 症状 -其他
    sympromOthers: [
      {pattern: NotLeadingAndTrailingSpaces, message: '首尾不能为空格！', trigger: ['change', 'blur']},
      {max: 100, message: '最多100个字符！', trigger: ['change', 'blur']}
    ],
    // 体温
    tempera: [
      {required: fieldRequired('tempera'), message: '请输入体温!', trigger: ['change', 'blur']},
      {pattern: Number_Decimal_3, message: '保留一位小数，包括小数最多三位数值!', trigger: ['change', 'blur']}
    ],
    // 脉率
    pulseRate: [
      {required: fieldRequired('pulseRate'), message: '请输入脉率!', trigger: ['change', 'blur']},
      {pattern: Number_3, message: '最多三个数字！', trigger: ['change', 'blur']}
    ],
    // 呼吸频率
    breathRate: [
      {required: fieldRequired('breathRate'), message: '请输入呼吸频率!', trigger: ['change', 'blur']},
      {pattern: Number_3, message: '最多三个数字！', trigger: ['change', 'blur']}
    ],
    // 收缩压(左)
    sbpLeft: [
      {required: fieldRequired('sbpLeft'), message: '请输入收缩压(左)!', trigger: ['change', 'blur']},
      {pattern: Number_3, message: '最多三个数字！', trigger: ['change', 'blur']}
    ],
    // 舒张压(左)
    dbpLeft: [
      {required: fieldRequired('dbpLeft'), message: '请输入舒张压(左)!', trigger: ['change', 'blur']},
      {pattern: Number_3, message: '最多三个数字！', trigger: ['change', 'blur']}
    ],
    // 收缩压(右)
    sbpRight: [
      {required: fieldRequired('sbpRight'), message: '请输入收缩压(右)!', trigger: ['change', 'blur']},
      {pattern: Number_3, message: '最多三个数字！', trigger: ['change', 'blur']}
    ],
    // 舒张压(右)
    dbpRight: [
      {required: fieldRequired('dbpRight'), message: '请输入舒张压(右)!', trigger: ['change', 'blur']},
      {pattern: Number_3, message: '最多三个数字！', trigger: ['change', 'blur']}
    ],
    // 身高
    height: [
      {required: fieldRequired('height'), message: '请输入身高!', trigger: ['change', 'blur']},
      {pattern: Number_Decimal_5, message: '最多五个数字，包括两位小数!', trigger: ['change', 'blur']}
    ],
    // 体重
    weight: [
      {required: fieldRequired('weight'), message: '请输入体重!', trigger: ['change', 'blur']},
      {pattern: Number_Decimal_5, message: '最多五个数字，包括两位小数!', trigger: ['change', 'blur']}
    ],
    // 腰围
    waist: [
      {required: fieldRequired('waist'), message: '请输入腰围!', trigger: ['change', 'blur']},
      {pattern: Number_Decimal_5, message: '最多五个数字，包括两位小数!', trigger: ['change', 'blur']}
    ],
    // 体质指数(BMI)
    bmi: [
      {required: fieldRequired('bmi'), message: '请输入身高体重计算(BMI)!', trigger: ['change', 'blur']},
      {pattern: Number_Decimal_5, message: '最多五个数字，包括两位小数!', trigger: ['change', 'blur']}
    ],
    // 老年人健康状态自我评估
    odSelfevalState: [{required: fieldRequired('odSelfevalState'), message: '请选择老年人健康状态自我评估!', trigger: ['change', 'blur']}],
    // 老年人生活自理能力自我评估
    odSelfcareState: [{required: fieldRequired('odSelfcareState'), message: '请选择老年人生活自理能力自我评估!', trigger: ['change', 'blur']}],
    // 老年人认知功能
    odCognState: [{required: fieldRequired('odCognState'), message: '请选择老年人认知功能!', trigger: ['change', 'blur']}],
    // 老年人情感状态
    odEmotionState: [{required: fieldRequired('odEmotionState'), message: '请选择老年人情感状态!', trigger: ['change', 'blur']}]
  }
})

/**
 * @description: 保存老年人生活自理能力评估
 * @return {*}
 */
const onConfirm = (data: {scoreInfor: string; totalScore: number}) => {
  generalSituationForm.odSelfcareScore = data.scoreInfor // 自理能力得分详情
  generalSituationForm.odSelfcareScoreTotal = data.totalScore // 总分
  if (data.totalScore >= 0 && data.totalScore <= 3) {
    generalSituationForm.odSelfcareState = 1
  } else if (data.totalScore >= 4 && data.totalScore <= 8) {
    generalSituationForm.odSelfcareState = 2
  } else if (data.totalScore >= 9 && data.totalScore <= 18) {
    generalSituationForm.odSelfcareState = 3
  } else if (data.totalScore >= 19) {
    generalSituationForm.odSelfcareState = 4
  }
}

/**
 * @description: 老年人认知功能-粗筛
 * @return {*}
 */
const onCognitiveFunctionScreeningConfirm = (data: {cognitiveFunctionScreening: string; cognitiveFunctionScreeningAgain: string}) => {
  // 拼接认知能力粗筛为字符串
  const odCognCribble = data.cognitiveFunctionScreening + '|' + data.cognitiveFunctionScreeningAgain
  generalSituationForm.odCognCribble = odCognCribble
  // 有一项为“错误”，则自动勾选“粗筛阳性”
  if (data.cognitiveFunctionScreening === '2' || data.cognitiveFunctionScreeningAgain === '2') {
    generalSituationForm.odCognState = 2
  } else {
    generalSituationForm.odCognState = 1
  }
}

/**
 * @description: 老年人认知功能-评估
 * @return {*}
 */
const onCognitiveFunctionAssessConfirm = (data: {scoreDetails: string; totalScore: number}) => {
  generalSituationForm.odCognScoreTotal = data.totalScore // 老年人认知功能总分
  generalSituationForm.odCognScore = data.scoreDetails // 认知能力得分明细
}

/**
 * @description: 老年人情感状态-粗筛
 * @return {*}
 */
const onEmotionalStateScreeningConfirm = (data: number) => {
  generalSituationForm.odEmotionState = generalSituationForm.odEmotionCribble = data
}

/**
 * @description:老年人情感状态-评估
 * @return {*}
 */
const onEmotionalStateAssessConfirm = (data: {scoreDetails: string; totalScore: number}) => {
  generalSituationForm.odEmotionScoreTotal = data.totalScore // 老年人情感状态总分
  generalSituationForm.odEmotionScore = data.scoreDetails // 老年人情感状态得分明细
}

/**
 * @description: 获取体检信息
 * @return {*}
 */
const getInitData = () => {
  props.checkupRegisterId &&
    getGeneralCondition(props.checkupRegisterId)
      .then((res) => {
        const {data} = res.data
        // 浅拷贝
        Object.assign(generalSituationForm, data)
        generalSituationForm.hasSymprom = !!data?.symprom && data?.symprom !== '1' // 有数据并且不等于'1'就是有症状
        generalSituationForm.sympromGroup =
          data?.symprom?.split('|')?.filter((item) => {
            return item !== '1' // 去掉勾选了无症状后的脏数据
          }) || [] // 症状多选
        // 初始默认值
        generalSituationForm.odSelfevalState = data?.odSelfevalState || 1 // 健康状态评估
        generalSituationForm.odSelfcareState = data?.odSelfcareState || 1 // 自理能力评估
        generalSituationForm.odSelfcareScore = data?.odSelfcareScore || '1|1|1|1|1' // 自理能力得分详情
        generalSituationForm.odSelfcareScoreTotal = data?.odSelfcareScoreTotal || 0 // 自理能力总分
        generalSituationForm.odCognState = data?.odCognState || 1 // 认知能力
        generalSituationForm.odCognCribble = data?.odCognCribble || '1|1' // 认知能力粗筛详情
        generalSituationForm.odCognScore = data?.odCognScore || '' // 认知能力得分
        generalSituationForm.odCognScoreTotal = data?.odCognScoreTotal || 0 // 认知能力总分
        generalSituationForm.odEmotionState = data?.odEmotionState || 1 // 情感状态
        generalSituationForm.odEmotionCribble = data?.odEmotionCribble || 0 // 情感状态粗筛详情
        generalSituationForm.odEmotionScore = data?.odEmotionScore || '' // 情感状态得分
        generalSituationForm.odEmotionScoreTotal = data?.odEmotionScoreTotal || 0 // 情感状态总分
      })
      .finally(() => {
        showSaveLoading.value = false
        formRef.value?.clearValidate()
      })
}

// 表单参数
const formDataParams = computed<GeneralConditionParams>(() => {
  return {
    symprom: generalSituationForm.hasSymprom ? generalSituationForm.sympromGroup.join('|') : '1', // 症状
    sympromOthers: generalSituationForm.sympromGroup?.indexOf('25') !== -1 ? generalSituationForm.sympromOthers : null, // 症状其他内容
    tempera: generalSituationForm.tempera, // 体温
    pulseRate: generalSituationForm.pulseRate, // 脉率
    breathRate: generalSituationForm.breathRate, // 呼吸频率
    sbpLeft: generalSituationForm.sbpLeft, // 收缩压(左)
    dbpLeft: generalSituationForm.dbpLeft, // 舒张压(左)
    sbpRight: generalSituationForm.sbpRight, // 收缩压(右)
    dbpRight: generalSituationForm.dbpRight, // 舒张压(右)
    height: generalSituationForm.height, // 身高
    weight: generalSituationForm.weight, // 体重
    waist: generalSituationForm.waist, // 腰围
    bmi: generalSituationForm.bmi, // 体质指数(BMI)
    odSelfevalState: generalSituationForm.odSelfevalState, // 健康状态评估
    odSelfcareState: generalSituationForm.odSelfcareState, // 自理能力评估
    odSelfcareScore: generalSituationForm.odSelfcareScore, // 自理能力得分详情
    odSelfcareScoreTotal: generalSituationForm.odSelfcareScoreTotal, // 自理能力总分
    odCognState: generalSituationForm.odCognState, // 认知能力
    odCognCribble: generalSituationForm.odCognCribble, // 认知能力粗筛详情
    odCognScore: generalSituationForm.odCognScore, // 认知能力得分
    odCognScoreTotal: generalSituationForm.odCognScoreTotal, // 认知能力总分
    odEmotionState: generalSituationForm.odEmotionState, // 情感状态
    odEmotionCribble: generalSituationForm.odEmotionCribble, // 情感状态粗筛
    odEmotionScore: generalSituationForm.odEmotionScore, // 情感状态得分
    odEmotionScoreTotal: generalSituationForm.odEmotionScoreTotal // 情感状态总分
  }
})

/**
 * @description: 保存
 * @return {*}
 */
const onSave1 = () => {
  formRef.value &&
    formRef.value.validate((valid: boolean, fields) => {
      if (valid) {
        if (!generalSituationForm.odCognScore && generalSituationForm.odCognState === 2) {
          ElMessage.error('请评估老年人认知功能!')
          return
        }
        if (!generalSituationForm.odEmotionScore && generalSituationForm.odEmotionState === 2) {
          ElMessage.error('请评估老年人情感状态!')
          return
        }
        showSaveLoading.value = true
        const params = {
          ...formDataParams.value,
          checkupStatus: 2, // 已检
          id: generalSituationForm.id, // 表单Id
          checkupRegisterId: props.checkupRegisterId, // 体检登记表id
          dutyDoctorId: generalSituationForm.dutyDoctorId || user.userInfor?.id, // 体检医生id
          dutyDoctorName: generalSituationForm.dutyDoctorId !== user.userInfor?.id ? generalSituationForm.dutyDoctorName || user.userInfor?.userName : user.userInfor?.userName // 体检医生姓名
        }
        saveGeneralCondition(params)
          .then(() => {
            getInitData()
            ElMessage.success('保存成功!')
          })
          .catch((err) => {
            console.warn(err)
            showSaveLoading.value = false
          })
      } else {
        console.warn(fields)
      }
    })
}

/**
 * @description: 拒检
 * @return {*}
 */
const onRejectInspection1 = () => {
  showMessageBox('是否对该体检大类进行拒检操作？', {title: '拒检确认', mesageType: 'base'})
    .then(() => {
      showSaveLoading.value = true
      const nullParams: GeneralConditionParams = {...formDataParams.value}
      // 置空
      Object.keys(formDataParams.value)?.forEach((item) => {
        nullParams[item] = null
      })
      const params: GeneralConditionParams = {
        ...nullParams,
        checkupStatus: 1, // 1拒检
        id: generalSituationForm.id, // 表单Id
        checkupRegisterId: props.checkupRegisterId, // 体检登记表id
        dutyDoctorId: generalSituationForm.dutyDoctorId || user.userInfor?.id, // 体检医生id
        dutyDoctorName: generalSituationForm.dutyDoctorId !== user.userInfor?.id ? generalSituationForm.dutyDoctorName || user.userInfor?.userName : user.userInfor?.userName // 体检医生姓名
      }
      rejectGeneralCondition(params)
        .then(() => {
          ElMessage.success('拒检成功!')
          getInitData()
        })
        .catch((error) => {
          showSaveLoading.value = false
          console.warn(error)
        })
    })
    .catch((error) => {
      console.warn(error)
    })
}
// 计算体质指数
watch(
  () => generalSituationForm.height,
  () => {
    if (generalSituationForm.height && generalSituationForm.weight) {
      const height = generalSituationForm.height * 0.01 // 身高
      const bim = generalSituationForm.weight / (height * height) // 体质指数
      generalSituationForm.bmi = Number(bim.toFixed(2))
    } else {
      generalSituationForm.bmi = null
    }
  }
)
// 计算体质指数
watch(
  () => generalSituationForm.weight,
  () => {
    if (generalSituationForm.height && generalSituationForm.weight) {
      const height = generalSituationForm.height * 0.01 // 身高
      const bim = generalSituationForm.weight / (height * height) // 体质指数
      generalSituationForm.bmi = Number(bim.toFixed(2))
    } else {
      generalSituationForm.bmi = null
    }
  }
)

watch(
  () => generalSituationForm.bmi,
  (value) => {
    value && formRef.value.clearValidate(['bmi'])
  }
)

onBeforeMount(() => {
  getInitData()
})
</script>
<template>
  <el-form ref="formRef" class="d-check-up-desk-content" label-position="top" :model="generalSituationForm" :rules="rules">
    <el-form-item label="症状" prop="generalSituationForm.hasSymprom" class="general-situation-form-item">
      <div class="label-symprom-group">
        <el-radio-group v-model="generalSituationForm.hasSymprom" :disabled="disEdit">
          <el-radio :label="false">
            无症状
          </el-radio>
          <el-radio :label="true">
            有症状
          </el-radio>
        </el-radio-group>
      </div>
      <el-form-item v-if="generalSituationForm.hasSymprom" prop="sympromGroup" class="symprom-group-item">
        <el-checkbox-group v-model="generalSituationForm.sympromGroup" :disabled="disEdit" class="symprom-group">
          <el-checkbox v-for="item in sympromCheckboxs" :key="item.value" :label="item.value">
            {{ item.label }}
          </el-checkbox>
          <el-form-item v-if="generalSituationForm.sympromGroup.indexOf('25') !== -1" prop="sympromOthers" class="other-symprom">
            <el-input v-model="generalSituationForm.sympromOthers" size="small" clearable :disabled="disEdit" />
          </el-form-item>
        </el-checkbox-group>
      </el-form-item>
    </el-form-item>
    <el-form-item label="一般状况" class="general-situation-form-item">
      <el-form-item v-for="item in generalSituationInput" :key="item.key" :label="item.label + ':'" :prop="item.key" class="general-ituation-infor">
        <el-input-number v-model="generalSituationForm[item.key]" :disabled="item.key === 'bmi' || disEdit" :controls="false" />
        <span>&nbsp;&nbsp;{{ item.unit }}</span>
      </el-form-item>
    </el-form-item>
    <el-form-item label="老年人健康状态自我评估" prop="odSelfevalState" class="general-situation-form-item">
      <el-radio-group v-model="generalSituationForm.odSelfevalState" :disabled="disEdit">
        <el-radio v-for="item in odSelfevalStateRadios" :key="item.value" :label="item.value">
          {{ item.label }}
        </el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="老年人生活自理能力自我评估" prop="odSelfcareState" class="general-situation-form-item">
      <div class="label-btn-box1">
        <el-button type="primary" @click="showSelfcareDialog = true">
          评估
        </el-button>
      </div>
      <el-radio-group v-model="generalSituationForm.odSelfcareState" :disabled="disEdit">
        <el-radio v-for="item in odSelfcareStateRadios" :key="item.value" :label="item.value" disabled>
          {{ item.label }}
        </el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="老年人认知功能" prop="odCognState" class="general-situation-form-item">
      <div class="label-btn-box">
        <el-button plain @click="cognitiveFunctionScreeningDialog = true">
          粗筛
        </el-button>
        <el-button type="primary" :disabled="generalSituationForm.odCognState !== 2" @click="cognitiveFunctionAssessDialog = true">
          评估
        </el-button>
      </div>
      <el-radio-group v-model="generalSituationForm.odCognState">
        <el-radio :label="1" disabled>
          粗筛阴性
        </el-radio>
        <el-radio :label="2" disabled>
          粗筛阳性，简易智力状态检查
        </el-radio>
      </el-radio-group>
      <span v-show="generalSituationForm.odCognState === 2" class="total-score">总分：{{ generalSituationForm.odCognScoreTotal }}</span>
    </el-form-item>
    <el-form-item label="老年人情感状态" prop="odEmotionState" class="general-situation-form-item">
      <div class="label-btn-box">
        <el-button plain @click="emotionalStateScreeningDialog = true">
          粗筛
        </el-button>
        <el-button type="primary" :disabled="generalSituationForm.odEmotionState !== 2" @click="emotionalStateAssessDialog = true">
          评估
        </el-button>
      </div>
      <el-radio-group v-model="generalSituationForm.odEmotionState">
        <el-radio :label="1" disabled>
          粗筛阴性
        </el-radio>
        <el-radio :label="2" disabled>
          粗筛阳性，老年抑郁量表检查
        </el-radio>
      </el-radio-group>
      <span v-show="generalSituationForm.odEmotionState === 2" class="total-score">总分：{{ generalSituationForm.odEmotionScoreTotal }}</span>
    </el-form-item>
  </el-form>
  <div class="d-check-up-desk-footer d-common-flex-center d-common-width-full">
    <span class="doctor">体检医生：</span>
    <el-input v-model="dutyDoctorName1" disabled />
    <el-button type="primary" :loading="showSaveLoading" :disabled="disEdit" @click="onSave1()">
      保存
    </el-button>
    <el-button type="danger" :loading="showSaveLoading" :disabled="(checkupStatus1 && checkupStatus1 === 1) || disEdit" plain @click="onRejectInspection1()">
      拒检
    </el-button>
  </div>
  <!-- 老年人生活自理能力自我评估  -->
  <od-selfcare-assess
    v-if="showSelfcareDialog"
    :show-dialog="showSelfcareDialog"
    :od-selfcare-score="generalSituationForm.odSelfcareScore || ''"
    @close="showSelfcareDialog = false"
    @confirm="onConfirm"
  />
  <!--老年人认知功能-粗筛 -->
  <cognitive-function-screening
    v-if="cognitiveFunctionScreeningDialog"
    :show-dialog="cognitiveFunctionScreeningDialog"
    :od-cogn-cribble="generalSituationForm.odCognCribble || ''"
    @close="cognitiveFunctionScreeningDialog = false"
    @confirm="onCognitiveFunctionScreeningConfirm"
  />
  <!-- 老年人认知功能-评估 -->
  <cognitive-function-assess
    v-if="cognitiveFunctionAssessDialog"
    :show-dialog="cognitiveFunctionAssessDialog"
    :od-cogn-score="generalSituationForm.odCognScore || ''"
    @close="cognitiveFunctionAssessDialog = false"
    @confirm="onCognitiveFunctionAssessConfirm"
  />
  <!--老年人情感状态-粗筛  -->
  <emotional-state-screening
    v-if="emotionalStateScreeningDialog"
    :show-dialog="emotionalStateScreeningDialog"
    :od-emotion-state="generalSituationForm.odEmotionState || 1"
    @close="emotionalStateScreeningDialog = false"
    @confirm="onEmotionalStateScreeningConfirm"
  />
  <!-- 老年人情感状态-评估 -->
  <emotional-state-assess
    v-if="emotionalStateAssessDialog"
    :show-dialog="emotionalStateAssessDialog"
    :od-emotion-score="generalSituationForm.odEmotionScore || ''"
    @close="emotionalStateAssessDialog = false"
    @confirm="onEmotionalStateAssessConfirm"
  />
</template>
<style scoped lang="less">
.general-situation-form-item {
  padding-bottom: 24px;
  margin-bottom: 19px;
  border-bottom: 1px solid rgba(195, 201, 210, 1);
  &:last-child {
    border-bottom: none;
  }
  :deep(.el-form-item__label) {
    color: var(--d-font-color-text);
    font-weight: bold;
    display: inline-flex;
    align-items: center;
  }
  :deep(.el-form-item__content) {
    margin-left: 23px;
  }
}
.symprom-group-item {
  :deep(.el-form-item__content) {
    margin-left: 0;
  }
}
.symprom-group {
  background: #f4f4f4;
  padding: 16px 47px;
  &::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 180px;
    border-right: solid 10px transparent;
    border-left: solid 10px transparent;
    border-bottom: solid 10px #f4f4f4;
  }
}
.other-symprom {
  display: inline-block;
  margin-bottom: 15px;

  position: relative;
  bottom: 2px;
  :deep(.el-form-item__content) {
    margin-left: 10px;
    padding: 0;
  }
  .el-input {
    width: 200px;
    height: 24px;
  }
}
.general-ituation-infor {
  display: inline-flex;
  margin-bottom: 18px;
  margin-right: 40px;
  :deep(.el-form-item__label) {
    margin-bottom: 0 !important;
    font-weight: normal;
  }
  :deep(.el-form-item__error) {
    white-space: nowrap;
  }
  .el-input-number {
    width: 80px;
  }
}
.total-score {
  margin-left: 60px;
}
.label-btn-box1 {
  position: absolute;
  top: -40px;
  left: 210px;
}
.label-btn-box {
  position: absolute;
  top: -40px;
  left: 120px;
}
.label-symprom-group {
  position: absolute;
  top: -40px;
  left: 50px;
}
</style>
